"""
* send_keys() --- 输入 （Keys类定义了键盘上除了26个字母和0-9数字外其它的按键。）
* click() --- 点击操作
* text --- 获取元素的文本内容(页面操作之后某些元素的文本发生变化)
* get_attribute() --- 获取元素的属性值
* clear() --- 清除内容

"""
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

driver = webdriver.Chrome()
driver.get("http://testingpai.com/")
# 获取元素的文本操作
text = driver.find_element(By.XPATH,'//nav[@class="nav-tabs"]/a').text
print(text)
# get_attribute() --- 获取元素的属性值

attr = driver.find_element(By.XPATH,'//nav[@class="nav-tabs"]/a').get_attribute("href")
print(attr)

"""
# clear 操作的案例演示
driver = webdriver.Chrome()
driver.maximize_window()
driver.get('https://www.baidu.com')
# driver.find_element(By.ID,'kw').send_keys('柠檬班')
# sleep(2)
# driver.find_element(By.ID,'kw').clear()

# # find_elements 用法
ele_list = driver.find_elements(By.XPATH,'//nav[@class="nav-tabs"]//a')
print(ele_list)
# for ele in ele_list:
#     print(ele.text)

"""